﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1_5._Default" %>

<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
    <script src="Scripts/jquery-3.4.1.min.js"></script>
    <script src="Scripts/js.js"></script>
    <style>
        td {
            width: 120px;
            text-align: center;
        }

        th {
            text-align: center;
        }
        #user{
            line-height:40px;
            padding:8px;
        }
    </style>

    <div id="user">
        <asp:Label ID="Label1" runat="server" Text="当前用户："></asp:Label>
        <asp:Label ID="userName" runat="server" Text="Label" ForeColor="Red"></asp:Label>
    </div>

    <asp:Button ID="addBtn" runat="server" Text="添加" OnClick="addBtn_Click" />&nbsp;&nbsp;
    <asp:Button ID="delBtn" runat="server" Text="删除" OnClick="delBtn_Click" />
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" OnPageIndexChanging="GridView1_PageIndexChanging" PageSize="5" OnRowEditing="GridView1_RowEditing" DataKeyNames="id">
        <Columns>
            <asp:TemplateField>
                <HeaderTemplate>
                    <asp:CheckBox runat="server" Text="全选" OnCheckedChanged="CheckBox1_CheckedChanged" AutoPostBack="true" />
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:CheckBox runat="server" />
                </ItemTemplate>
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" Width="50px" />
            </asp:TemplateField>
            <asp:BoundField DataField="Id" ReadOnly="true" HeaderText="Id" SortExpression="Id" ControlStyle-Width="50">
                <ControlStyle Width="50px"></ControlStyle>
                <ItemStyle HorizontalAlign="Center" Width="20px" />
            </asp:BoundField>
            <asp:BoundField DataField="Title" HeaderText="标题" SortExpression="Title" />
            <asp:BoundField DataField="Author" HeaderText="作者" SortExpression="Author" />
            <asp:BoundField DataField="Content" HeaderText="内容" SortExpression="Content" />
            <asp:BoundField DataField="Remarks" HeaderText="备注" SortExpression="Remarks" />
            <asp:CommandField HeaderText="操作" ShowCancelButton="False" ShowEditButton="True" ShowHeader="True" />

        </Columns>
        <SelectedRowStyle BackColor="Silver" />
    </asp:GridView>


    <br />

</asp:Content>
